package com.wsdcd.zlg.model.service;

import com.wsdcd.zlg.mapper.UserMapper;
import com.wsdcd.zlg.mapper.impl.UserMapperImpl;
import com.wsdcd.zlg.model.entity.User;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Set;

@Service
public class UserService {
//    @Setter
    private UserMapper userMapper;

//    @Resource(name = "userMapper")
    public void setUserMapper(UserMapper userMapper){
        this.userMapper = userMapper;
    }

//    @Setter
//    private int w;

//    public UserService(UserMapperImpl userMapper){
//        this.userMapper = userMapper;
//    }

    public UserService() {
        System.err.println("UserService构造方法");
    }
    public void init(){
        System.err.println("init--------");
    }
    public void destroy(){
        System.err.println("destroy----------");
    }


    public List<User> select(){
//        System.err.println(w);
//        List list = userMapper.getLists();
//        Set set = userMapper.getSets();
//        Map map = userMapper.getMaps();
//        System.err.println(list);
//        System.out.println(set);
//        System.err.println(map);
        return userMapper.select();
    }
}
